import * as express from 'express';
import messageController from '../../controllers/messageController';

const router = express.Router()

// 获取双方共同的最后一条消息
router.get('/lastMsg', messageController.getLastMessage)
// 插入消息
router.post('/insert', messageController.inertMsg)
// 获取双方的聊天消息
router.get('/msgs', messageController.getMsg)
// 获取消息未读数量
router.get('/unread', messageController.getUnReadCount)
// 更改消息状态为已读
router.put('/upstate', messageController.updateMsgState)
// 查询是否有未读消息
router.get('/isunread', messageController.getIsHadUnReadMsg)
export default router